﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace rock.UI.system
{
    public partial class FormSystemLock : Form
    {
        public FormSystemLock()
        {
            InitializeComponent();
            this.AcceptButton = this.button1;
   
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.WindowState = FormWindowState.Normal;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = global::rock.Properties.Resources.house;
        }

        private void FormSystemLock_Load(object sender, EventArgs e)
        {
            this.textBox2Username.Text = Manager.getInstance().userAccount.ACCOUNT;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(this.textBox1Pwd.Text!=null && this.textBox1Pwd.Text.Equals(Manager.getInstance().userAccount.PASSWORD)){
                this.Close();
            }else{
                MessageBox.Show("请输入正确的密码,谢谢!");
            }
        }

        private void FormSystemLock_FormClosing(object sender, FormClosingEventArgs e)
        {
             

            if (this.textBox1Pwd.Text != null && this.textBox1Pwd.Text.Equals(Manager.getInstance().userAccount.PASSWORD))
            {
                e.Cancel = false;
            }
            else

            {
                MessageBox.Show("请输入正确的密码,谢谢!");
                e.Cancel = true;
            }
        }
    }
}
